package com.example.demo.controller;

import com.example.demo.entity.DepartmentEntity;
import com.example.demo.service.DepartmentService;
import com.example.demo.tool.ResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@Api(tags = "部门")
public class DepartmentController {
    @Autowired
    private DepartmentService departmentService;

    @GetMapping("allDepartment/list")
    @ApiOperation("获取部门信息")
    public ResponseResult departlist(){
        List<DepartmentEntity> list = departmentService.list();
        return ResponseResult.success(list);
    }
}
